const getters = {
  device: state => state.app.device,
  theme: state => state.app.theme,
  color: state => state.app.color,
  token: state => state.user.token,
  avatar: state => state.user.avatar,
  nickname: state => state.user.name,
  welcome: state => state.user.welcome,
  roles: state => state.user.roles,
  userInfo: state => state.user.info,
  STORE_ID: state => state.user.STORE_ID, // 门店id
  STORE_LIST: state => state.user.STORE_LIST, // 门店List
  OPERATOR_TYPE: state => state.user.OPERATOR_TYPE, // 对应门店的经营类型
  storeRefreshTime: state => state.user.storeRefreshTime, // 门店刷新时间
  addRouters: state => state.permission.addRouters,
  multiTab: state => state.app.multiTab,
  // 入住管理列表切换
  orderListMenu: state => state.order.orderListMenu,
  orderDataList: state => state.order.orderDataList,
  orderParams: state => state.order.orderParams,
  orderLoading: state => state.order.orderLoading,
  orderTotal: state => state.order.orderTotal,
  // 房态管理
  orderList: state => state.status.orderList,
  orders: state => state.status.orders,
  rooms: (state) => {
    const orderList = state.status.orderList
    const roomList = []
    const weekDayList = ['日', '一', '二', '三', '四', '五', '六']
    if (orderList) {
      for (const key in orderList) {
        const weekDay = new Date(Date.parse(key.replace(/-/g, '/')))
        roomList.push({ date: key, syfy: orderList[key].syfy, weekDay: weekDayList[weekDay.getDay()] })
      }
      roomList.sort((firstDate, SecDate) => {
        const aa = new Date(firstDate.date)
        const bb = new Date(SecDate.date)
        return aa - bb
      })
      return roomList
    }
  },
  currentSelectedDate: state => state.status.currentSelectedDate,
  ldsjSelectedDate: state => state.status.ldsjSelectedDate,
  // 公用行政区域（杭州）
  administrativeRegion: state => state.administrativeRegion.administrativeRegion,
  lang: state => state.i18n.lang,
  // 房源管理
  houseSourceDataList: state => state.houseSource.houseSourceDataList,
  houseParams: state => state.houseSource.houseParams,
  houseLoading: state => state.houseSource.houseLoading,
  // 门锁列表
  lockDataList: state => state.lock.lockDataList,
  lockParams: state => state.lock.lockParams,
  lockLoading: state => state.lock.lockLoading,
  lockTotal: state => state.lock.lockTotal,
  // 开门记录
  openRecordDataList: state => state.lock.openRecordDataList,
  openRecordParams: state => state.lock.openRecordParams,
  openRecordLoading: state => state.lock.openRecordLoading,
  openRecordTotal: state => state.lock.openRecordTotal
}

export default getters
